package com.yikome.product.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.yikome.common.BaseEntity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 产品分类,这里的分类特指的是后端管理层面的分类
 */
@Setter
@Getter
@NoArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "c_category")
public class Category extends BaseEntity{

	private static final long serialVersionUID = -8478180140940938209L;
	
	private String name;
    
	@Column(columnDefinition = "bigint(20) NULL DEFAULT 0")
    private Long parentId;
    
    private Integer priority;
    
    private String comments ; 
    
    @Transient
	private List<Category> categories;
    
}